<?php

class operatorlog_application_register extends base_application_prototype_xml {

    var $xml = 'operatorlog.xml';

    var $xsd = 'operatorlog_content';

    var $path = 'register';

    public function current() {
        $this->current = $this->iterator()->current();
        return $this;
    }

    final public function install() {
        // $this->target_app->app_id;
        $data = $this->current;
        $data['app'] = $this->target_app->app_id;
        $arr_method = array(
            'get' => 'get',
            'post' => 'post'
        );
        $data['method'] = $arr_method[strtolower($data['method'])] ? $arr_method[strtolower($data['method'])] : 'post';
        app::get('operatorlog')->model('register')->insert($data);
    }
 // End Function
    function clear_by_app($app_id) {
        if (! $app_id) {
            return false;
        }
        app::get('operatorlog')->model('register')->delete(array(
            'app' => $app_id
        ));
    }
}//End Class